package com.jt.spring.demo2;

import com.jt.spring.demo2.config.SpringComfig;
import com.jt.spring.demo2.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAspect {
    public static void main(String[] args) {
        ApplicationContext context=
                new AnnotationConfigApplicationContext(SpringComfig.class);
        //看上去：是目标对象  AOP:内部已经封装动态代理规则
        UserService userService = context.getBean(UserService.class);
        System.out.println(userService.getClass());
        //userService.addUser();
        userService.findName();
    }
}
